Data was simulated using VirtualCommunity code.
Simulated data contains 20 data sets.
In this file we have compared the 3 models HMSC,GJAM, JSDM on 21 simulated Dataset.\ We have compared the ability to recover the true interactions used for modelling this datasets, by comparing estimated correlation matrix and matrix representing true interactions.
There is a separate file, with the functions needed to fit each model and study the convergence and more parameters are presented.
## Environment filtering 5 species
Convergence:
Study of interactions
ALL3<-function(jsdm_mod,gjam_mod,hmsc_mod,interact=diag(5)){
par(mfrow=c(2,2),oma = c(1, 1, 1, 1))
corrplot(jsdm_mod, diag = FALSE, order = "original",tl.pos = "ld", tl.cex = 0.5, method = "color",col=cols(200), type = "lower")
title("R JSDM ")
corrplot(gjam_mod, diag = FALSE, order = "original",tl.pos = "ld", tl.cex = 0.5, method = "color",col=cols(200), type = "lower")
title("R GJAM")
corrplot(hmsc_mod, diag = FALSE, order = "original",tl.pos = "ld", tl.cex = 0.5, method = "color",col=cols(200), type = "lower")
title("R HMSC")
corrplot(interact, diag = FALSE, order = "original",tl.pos = "ld", tl.cex = 0.5, method = "color",col=cols(200), type = "lower")
title("True interactions")
}
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,diag(5))
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,diag(10))
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,diag(20))
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[4]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[5]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[6]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[8]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[8]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,fac_inter[[9]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[10]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[11]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[12]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[13]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[14]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc,(-1)*comp_inter[[15]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[16]]+ fac_inter[[16]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[17]]+ fac_inter[[17]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[18]]+ fac_inter[[18]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[19]]+ fac_inter[[19]])
## Environmental filtering + Competition +Facilitation 10 sparse species
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[20]]+ fac_inter[[20]])
ALL3(mod_list$jsdm,mod_list$gjam,mod_list$hmsc, (-1)*comp_inter[[21]]+ fac_inter[[21]])